<include file="Public/head" />
<link rel="stylesheet" href="/static/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="/static/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="/static/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="/static/kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="/static/kindeditor/plugins/code/prettify.js"></script>
</head>
<include file="Public/common_header" />
<div class="mian">
    <include file="Public/sidebar"  menu="clcwht.zxgl" />

    <div class="mianR">
        <h3 class="yonghu">问题类型管理-<if condition="$category">编辑<else/>新建</if></h3>
		<div class="newly-build">
			<ul>
				<li><span>类型名称</span><input type="text" value="{$category.category_name}" id="category_name" class="build-title" /></li>
			</ul>
		</div>
		<div class="yongBtn">
			<input onclick="saveCategory('{$category.id}');" type="button" value="保存" class="queding">
			<input type="button" onclick="history.go(-1);" value="取消" class="queding">
		</div>
    </div>
    <div class="clear"></div>
    <include file="Public/foot" />
<script>
function saveCategory(id) {
	var category_name = $('#category_name').val();
	if (!category_name) {
		alert('请填写类型名称');
		return false;
	}
	$.post('/Question/saveQuestionCategory', {'id':id, 'category_name':category_name}, function(data){
		if (data.code == '200') {
			alert(data.msg);
			window.location = '/Question/questionCategory';
		} else {
			alert(data.msg);
		}
	},'json');

}


</script>
    
    